package com.gemme.gemme.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.gemme.gemme.R;

public class TvEditText extends RelativeLayout {
    private Context context;

    public TvEditText(Context context) {
        this(context,null);
    }

    public TvEditText(Context context, AttributeSet attrs) {
        this(context, attrs,0);
    }

    public TvEditText(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.context = context;
        initView();
    }
    TextView leftTv;
    EditText editV;
    private void initView() {
        LayoutInflater.from(context).inflate(R.layout.tv_edit,this);

        leftTv = findViewById(R.id.leftTv);

        editV = findViewById(R.id.editV);
    }

    public TvEditText setLeftText(String leftText){
        leftTv.setText(leftText + "");
        return this;
    }

    public TvEditText setRightText(String rightText){
        editV.setText(rightText + "");
        return this;
    }


    public TvEditText setRightHintText(String rightHintText){
        editV.setHint(rightHintText + "");
        return this;
    }

    public String getContent(){
        return editV.getText() + "";
    }

}
